<template>
	<view class="my-kh-policy-list">
		<view class="my-kh-policy-list-cell" v-for="item in dataList" :key="item.id">
			<view class="my-kh-policy-list-cell-top">
				<text>{{item.assessmentName}}</text>
				<text>{{item.remark}}</text>
			</view>
			
			<view class="my-kh-policy-list-cell-bottom">
				<text>考核扣款</text>
				<text>{{item.assessmentAmount}}元</text>
			</view>
		</view>
		<xh-empty minHeight="50vh" :show="dataList.length == 0"></xh-empty>
	</view>
</template>

<script setup>
	import { onMounted,ref } from 'vue'
	import { getAssessmentList } from '@/common/api/api.js'
	const props = defineProps({
		policyId: {
			type: Number,
			default: 0
		}
	})
	const dataList = ref([])
	
	const queryList = async ()=>{
		let params = {}
		if (props.policyId) {
			params.policyId = props.policyId
		}
		const res = await getAssessmentList(params)
		dataList.value = res.result
	}
	onMounted(()=>{
		queryList()
	})
</script>

<style lang="scss" scoped>
.my-kh-policy-list{
	.my-kh-policy-list-cell{
		background-color: #fff;
		border-radius: 16rpx;
		margin-bottom: 30rpx;
		.my-kh-policy-list-cell-top{
			position: relative;
			display: flex;
			flex-direction: column;
			padding: 30rpx;
			border-bottom: 1px solid #eee;
			text:nth-child(1){
				color: #E01300;
			}
			text:nth-child(2){
				font-size: 24rpx;
				margin-top: 16rpx;
			}
		}
		.my-kh-policy-list-cell-bottom{
			padding: 30rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
		}
	}
}
</style>